<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\card\controller;

class GetImage extends \app\BaseController
{
    public function getImage()
    {
        $param = $this->request->param();
        $path = $param["path"] ?? NULL;
        if(!$path) {
            return $this->error("请传入参数");
        }
        $path = str_replace("https://", "http://", $path);
        $type_img = getimagesize($path);
        ob_start();
        if(strpos($type_img["mime"], "jpeg")) {
            $resourch = imagecreatefromjpeg($path);
            imagejpeg($resourch);
        } elseif(strpos($type_img["mime"], "png")) {
            $resourch = imagecreatefrompng($path);
            imagepng($resourch);
        }
        $content = ob_get_clean();
        imagedestroy($resourch);
        return response($content, 200, ["Content-Length" => strlen($content)])->contentType("image/png");
    }
}

?>